package com.sl.core.engine.datasource.func;

import cn.hutool.core.util.StrUtil;
import org.beetl.core.Context;
import org.beetl.core.Function;

public class IsNotEmptyFunction implements Function {
    @Override
    public Object call(Object[] paras, Context ctx) {


        if (paras.length == 0)
            return false;

        if (paras.length == 1) {
            Object result = paras[0];
            if(!(result instanceof  String)){
                return false;
            }
            return StrUtil.isNotBlank(StrUtil.toString(result));
        }

        return false;

    }
}
